@*+:cnd:noEmit*@
@attribute [Route(PageUrls.ForgotPassword)]
@attribute [Route("{culture?}" + PageUrls.ForgotPassword)]
@inherits AppPageBase

<AppPageData Title="@Localizer[nameof(AppStrings.ForgotPasswordPageTitle)]" />

<section>
    <BitStack HorizontalAlign="BitAlignment.Center">
        <BitStack HorizontalAlign="BitAlignment.Center" FillContent Class="max-width">
            <BitText Typography="BitTypography.H4">@Localizer[nameof(AppStrings.ForgotPasswordTitle)]</BitText>

            <BitText Typography="BitTypography.Subtitle1" Align="BitTextAlign.Center">
                @Localizer[nameof(AppStrings.ForgotPasswordMessage)]
            </BitText>
            <br />
            <EditForm Model="model" OnValidSubmit="WrapHandled(Submit)" novalidate>
                <AppDataAnnotationsValidator />
                <BitStack FillContent Gap="2rem">
                    <BitStack FillContent>
                        <BitPivot Alignment="BitAlignment.Center" DefaultSelectedKey="@EmailKey" OnChange="OnPivotChange">
                            <BitPivotItem HeaderText="@Localizer[nameof(AppStrings.Email)]" Key="@EmailKey">
                                <BitTextField @bind-Value="model.Email"
                                              AutoFocus
                                              Type="BitInputType.Email"
                                              Immediate DebounceTime="500"
                                              Label="@Localizer[nameof(AppStrings.Email)]"
                                              Placeholder="@Localizer[nameof(AppStrings.EmailPlaceholder)]" />
                                <ValidationMessage For="@(() => model.Email)" />
                            </BitPivotItem>

                            <BitPivotItem HeaderText="@Localizer[nameof(AppStrings.PhoneNumber)]" Key="@PhoneKey">
                                <BitTextField @bind-Value="model.PhoneNumber"
                                              AutoFocus
                                              Type="BitInputType.Tel"
                                              Immediate DebounceTime="500"
                                              Label="@Localizer[nameof(AppStrings.PhoneNumber)]"
                                              Placeholder="@Localizer[nameof(AppStrings.PhoneNumberPlaceholder)]" />
                                <ValidationMessage For="@(() => model.PhoneNumber)" />
                            </BitPivotItem>
                        </BitPivot>
                    </BitStack>
                    <BitButton IsLoading="isWaiting"
                               Class="form-submit-button"
                               ButtonType="BitButtonType.Submit">
                        @Localizer[nameof(AppStrings.Submit)]
                    </BitButton>
                </BitStack>
            </EditForm>
            <br />
            <div>
                @Localizer[nameof(AppStrings.ResetPasswordMessageInForgot)]
                <BitLink Href="@($"{PageUrls.ResetPassword}?return-url={Uri.EscapeDataString(ReturnUrlQueryString ?? PageUrls.Home)}")">@Localizer[nameof(AppStrings.ResetPassword)]</BitLink>
            </div>

            <BitStack Horizontal HorizontalAlign="BitAlignment.Center">
                <BitLink Href="@($"{PageUrls.SignIn}?return-url={Uri.EscapeDataString(ReturnUrlQueryString ?? PageUrls.Home)}")">@Localizer[nameof(AppStrings.SignIn)]</BitLink>
                <BitText>@Localizer[nameof(AppStrings.Or)]</BitText>
                <BitLink Href="@($"{PageUrls.SignUp}?return-url={Uri.EscapeDataString(ReturnUrlQueryString ?? PageUrls.Home)}")">@Localizer[nameof(AppStrings.SignUp)]</BitLink>
            </BitStack>
        </BitStack>
    </BitStack>
</section>
